<?php

namespace common\models\shop;

use Yii;

/**
 * This is the model class for table "{{%shop_brand}}".
 *
 * @property int $id
 * @property string $name 品牌名称
 * @property string $code 品牌编码
 * @property string $description 品牌简介
 * @property string $logo 品牌LOGO
 * @property int $status 状态
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 * @property int $deleted_at 删除时间
 */
class ShopBrand extends \common\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%shop_brand}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['name'], 'required'],
            [['status', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['name'], 'string', 'max' => 50],
            [['code'], 'string', 'max' => 10],
            [['description', 'logo'], 'string', 'max' => 255],
            [['code'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'name' => '品牌名称',
            'code' => '品牌编码',
            'description' => '品牌简介',
            'logo' => '品牌LOGO',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'deleted_at' => '删除时间',
        ];
    }

}
